//
//  SourceModel.m
//  Shengzhuli
//
//  Created by FXGuo on 17/3/30.
//  Copyright © 2017年 kamangkeji. All rights reserved.
//

#import "SourceModel.h"

@implementation SourceModel

- (instancetype)initWithDict:(NSDictionary *)dict
{
    if (self = [super init]) {
        self.industryName = dict[@"industryName"];
        self.ID = [dict[@"id"] integerValue];
        self.parentId = [dict[@"parentId"] integerValue];
        NSArray *list = dict[@"industryList"];
        if (list.count>0) {
            NSMutableArray *arr = [NSMutableArray array];
            for (NSDictionary *dict in list) {
                SourceModel *model = [SourceModel objectWithDict:dict];
                model.parentModel = self;
                [arr addObject:model];
            }
            self.industryList = arr;
        }
    }
    return self;
}

+ (instancetype)objectWithDict:(NSDictionary *)dict
{
    return [[SourceModel alloc]initWithDict:dict];
}
- (NSMutableArray *)selectIds
{
    if (!_selectIds) {
        _selectIds = [NSMutableArray array];
    }
    return _selectIds;
}
- (NSMutableArray *)selectIdNames
{
    if (!_selectIdNames) {
        _selectIdNames = [NSMutableArray array];
    }
    return _selectIdNames;
}

@end
